Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / core / ui / src / commonMain / kotlin / org / meshtastic / core / ui / component / EventPaletteStrip.kt

Displaying Raw • Download

core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/EventPaletteStrip.kt 2d20cd8a4708e2ef66e98d5259f3a97ec93f240a (2d20cd8a) Text, 2.29 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.ui.component

Tff7b72import T7ee787androidx.compose.foundation.background
Tff7b72import T7ee787androidx.compose.foundation.layout.Box
Tff7b72import T7ee787androidx.compose.foundation.layout.fillMaxWidth
Tff7b72import T7ee787androidx.compose.foundation.layout.height
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.remember
Tff7b72import T7ee787androidx.compose.ui.Modifier
Tff7b72import T7ee787androidx.compose.ui.graphics.Brush
Tff7b72import T7ee787androidx.compose.ui.graphics.Color
Tff7b72import T7ee787androidx.compose.ui.graphics.SolidColor
Tff7b72import T7ee787androidx.compose.ui.unit.Dp

T8b949e/**
* Full-width band of an event edition's brand [palette], left to right in authored order.
*
* The ambient accent wash can only ever carry one color, and for editions whose primary is very dark (DEF CON's navy)
* it is nearly invisible against a dark surface — this strip is where the rest of the palette actually shows up. Used
* as a hairline rule under [MainAppBar] and as the closing edge of the [EventInfoSheet] header.
*
* Draws nothing for an empty palette, and a flat band rather than a gradient when the edition publishes a single color.
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffEventPaletteStripTb4b4b4(Te6edf3paletteTb4b4b4: Te6edf3ListTff7b72<Te6edf3ColorTff7b72>Tb4b4b4, Te6edf3heightTb4b4b4: Te6edf3DpTb4b4b4, Te6edf3modifierTb4b4b4: Te6edf3Modifier Tff7b72= Te6edf3ModifierTb4b4b4) Tb4b4b4{
Tff7b72if Tb4b4b4(Te6edf3paletteTb4b4b4.Te6edf3isEmptyTb4b4b4(Tb4b4b4)Tb4b4b4) Tff7b72return
Tff7b72val Te6edf3brush Tff7b72=
Te6edf3rememberTb4b4b4(Te6edf3paletteTb4b4b4) Tb4b4b4{
Tff7b72if Tb4b4b4(Te6edf3paletteTb4b4b4.Te6edf3size Tff7b72>Tff7b72= Te6edf3MIN_GRADIENT_STOPSTb4b4b4) Te6edf3BrushTb4b4b4.Te6edf3horizontalGradientTb4b4b4(Te6edf3paletteTb4b4b4) Tff7b72else Te6edf3SolidColorTb4b4b4(Te6edf3paletteTb4b4b4.Te6edf3firstTb4b4b4(Tb4b4b4)Tb4b4b4)
Tb4b4b4}
Te6edf3BoxTb4b4b4(Te6edf3modifierTb4b4b4.Te6edf3fillMaxWidthTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3heightTb4b4b4(Te6edf3heightTb4b4b4)Tb4b4b4.Te6edf3backgroundTb4b4b4(Te6edf3brushTb4b4b4)Tb4b4b4)
Tb4b4b4}

T8b949e/** A gradient needs two stops; a single-color palette is drawn as a flat band instead. */
Tff7b72private Tff7b72const Tff7b72val Te6edf3MIN_GRADIENT_STOPS Tff7b72= T79c0ff2

Served by rngit 1.5.0 - Generated in 0.04s